﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections.ObjectModel;
using QinTools.Utilities;
using System.ComponentModel;

namespace QinTools.Model.Characters
{
    public class Character : INotifyPropertyChanged
    {
        public event PropertyChangedEventHandler PropertyChanged;
        public Character()
        {
            DefiningDeeds = new ObservableCollection<string>();
            FireSkills = new ObservableCollection<CharacterAbility>();
            MetalSkills = new ObservableCollection<CharacterAbility>();
            EarthSkills = new ObservableCollection<CharacterAbility>();
            WaterSkills = new ObservableCollection<CharacterAbility>();
            WoodSkills = new ObservableCollection<CharacterAbility>();
            Taos = new ObservableCollection<CharacterAbility>();
            Equipment = new ObservableCollection<string>();
            Weapons = new ObservableCollection<CharacterWeapon>();
        }

        // Character Info
        #region Name Notified Property
        private string _Name;
        public string Name
        {
            get
            {
                return _Name;
            }
            set
            {
                _Name = value;
                if (PropertyChanged != null)
                {
                    PropertyChanged(this, new PropertyChangedEventArgs(this.GetSymbolName(p => p.Name)));
                }
            }
        }
        #endregion
        #region CharacterType Notified Property
        private string _CharacterType;
        public string CharacterType
        {
            get
            {
                return _CharacterType;
            }
            set
            {
                _CharacterType = value;
                if (PropertyChanged != null)
                {
                    PropertyChanged(this, new PropertyChangedEventArgs(this.GetSymbolName(p => p.CharacterType)));
                }
            }
        }
        #endregion
        #region HomeState Notified Property
        private string _HomeState;
        public string HomeState
        {
            get
            {
                return _HomeState;
            }
            set
            {
                _HomeState = value;
                if (PropertyChanged != null)
                {
                    PropertyChanged(this, new PropertyChangedEventArgs(this.GetSymbolName(p => p.HomeState)));
                }
            }
        }
        #endregion
        #region Height Notified Property
        private string _Height;
        public string Height
        {
            get
            {
                return _Height;
            }
            set
            {
                _Height = value;
                if (PropertyChanged != null)
                {
                    PropertyChanged(this, new PropertyChangedEventArgs(this.GetSymbolName(p => p.Height)));
                }
            }
        }
        #endregion
        #region Weight Notified Property
        private string _Weight;
        public string Weight
        {
            get
            {
                return _Weight;
            }
            set
            {
                _Weight = value;
                if (PropertyChanged != null)
                {
                    PropertyChanged(this, new PropertyChangedEventArgs(this.GetSymbolName(p => p.Weight)));
                }
            }
        }
        #endregion
        #region Gender Notified Property
        private string _Gender;
        public string Gender
        {
            get
            {
                return _Gender;
            }
            set
            {
                _Gender = value;
                if (PropertyChanged != null)
                {
                    PropertyChanged(this, new PropertyChangedEventArgs(this.GetSymbolName(p => p.Gender)));
                }
            }
        }
        #endregion
        #region Age Notified Property
        private string _Age;
        public string Age
        {
            get
            {
                return _Age;
            }
            set
            {
                _Age = value;
                if (PropertyChanged != null)
                {
                    PropertyChanged(this, new PropertyChangedEventArgs(this.GetSymbolName(p => p.Age)));
                }
            }
        }
        #endregion
        #region Gift Notified Property
        private string _Gift;
        public string Gift
        {
            get
            {
                return _Gift;
            }
            set
            {
                _Gift = value;
                if (PropertyChanged != null)
                {
                    PropertyChanged(this, new PropertyChangedEventArgs(this.GetSymbolName(p => p.Gift)));
                }
            }
        }
        #endregion
        #region Weakness Notified Property
        private string _Weakness;
        public string Weakness
        {
            get
            {
                return _Weakness;
            }
            set
            {
                _Weakness = value;
                if (PropertyChanged != null)
                {
                    PropertyChanged(this, new PropertyChangedEventArgs(this.GetSymbolName(p => p.Weakness)));
                }
            }
        }
        #endregion
        #region Renown Notified Property
        private int _Renown;
        public int Renown
        {
            get
            {
                return _Renown;
            }
            set
            {
                _Renown = value;
                if (PropertyChanged != null)
                {
                    PropertyChanged(this, new PropertyChangedEventArgs(this.GetSymbolName(p => p.Renown)));
                }
            }
        }
        #endregion
        #region Experience Notified Property
        private int _Experience;
        public int Experience
        {
            get
            {
                return _Experience;
            }
            set
            {
                _Experience = value;
                if (PropertyChanged != null)
                {
                    PropertyChanged(this, new PropertyChangedEventArgs(this.GetSymbolName(p => p.Experience)));
                }
            }
        }
        #endregion
        public ObservableCollection<string> DefiningDeeds { get; private set; }

        // Character Stats
        #region FireAspect Notified Property
        private int _FireAspect;
        public int FireAspect
        {
            get
            {
                return _FireAspect;
            }
            set
            {
                _FireAspect = value;
                if (PropertyChanged != null)
                {
                    PropertyChanged(this, new PropertyChangedEventArgs(this.GetSymbolName(p => p.FireAspect)));
                }
            }
        }
        #endregion
        #region MetalAspect Notified Property
        private int _MetalAspect;
        public int MetalAspect
        {
            get
            {
                return _MetalAspect;
            }
            set
            {
                _MetalAspect = value;
                if (PropertyChanged != null)
                {
                    PropertyChanged(this, new PropertyChangedEventArgs(this.GetSymbolName(p => p.MetalAspect)));
                }
            }
        }
        #endregion
        #region EarthAspect Notified Property
        private int _EarthAspect;
        public int EarthAspect
        {
            get
            {
                return _EarthAspect;
            }
            set
            {
                _EarthAspect = value;
                if (PropertyChanged != null)
                {
                    PropertyChanged(this, new PropertyChangedEventArgs(this.GetSymbolName(p => p.EarthAspect)));
                }
            }
        }
        #endregion
        #region WoodAspect Notified Property
        private int _WoodAspect;
        public int WoodAspect
        {
            get
            {
                return _WoodAspect;
            }
            set
            {
                _WoodAspect = value;
                if (PropertyChanged != null)
                {
                    PropertyChanged(this, new PropertyChangedEventArgs(this.GetSymbolName(p => p.WoodAspect)));
                }
            }
        }
        #endregion
        #region WaterAspect Notified Property
        private int _WaterAspect;
        public int WaterAspect
        {
            get
            {
                return _WaterAspect;
            }
            set
            {
                _WaterAspect = value;
                if (PropertyChanged != null)
                {
                    PropertyChanged(this, new PropertyChangedEventArgs(this.GetSymbolName(p => p.WaterAspect)));
                }
            }
        }
        #endregion
        #region NormalHp Notified Property
        private int _NormalHp;
        public int NormalHp
        {
            get
            {
                return _NormalHp;
            }
            set
            {
                _NormalHp = value;
                if (PropertyChanged != null)
                {
                    PropertyChanged(this, new PropertyChangedEventArgs(this.GetSymbolName(p => p.NormalHp)));
                }
            }
        }
        #endregion
        #region BruisedHp Notified Property
        private int _BruisedHp;
        public int BruisedHp
        {
            get
            {
                return _BruisedHp;
            }
            set
            {
                _BruisedHp = value;
                if (PropertyChanged != null)
                {
                    PropertyChanged(this, new PropertyChangedEventArgs(this.GetSymbolName(p => p.BruisedHp)));
                }
            }
        }
        #endregion
        #region LightlyInjuredHp Notified Property
        private int _LightlyInjuredHp;
        public int LightlyInjuredHp
        {
            get
            {
                return _LightlyInjuredHp;
            }
            set
            {
                _LightlyInjuredHp = value;
                if (PropertyChanged != null)
                {
                    PropertyChanged(this, new PropertyChangedEventArgs(this.GetSymbolName(p => p.LightlyInjuredHp)));
                }
            }
        }
        #endregion
        #region SeriouslyInjuredHp Notified Property
        private int _SeriouslyInjuredHp;
        public int SeriouslyInjuredHp
        {
            get
            {
                return _SeriouslyInjuredHp;
            }
            set
            {
                _SeriouslyInjuredHp = value;
                if (PropertyChanged != null)
                {
                    PropertyChanged(this, new PropertyChangedEventArgs(this.GetSymbolName(p => p.SeriouslyInjuredHp)));
                }
            }
        }
        #endregion
        #region FatallyInjuredHp Notified Property
        private int _FatallyInjuredHp;
        public int FatallyInjuredHp
        {
            get
            {
                return _FatallyInjuredHp;
            }
            set
            {
                _FatallyInjuredHp = value;
                if (PropertyChanged != null)
                {
                    PropertyChanged(this, new PropertyChangedEventArgs(this.GetSymbolName(p => p.FatallyInjuredHp)));
                }
            }
        }
        #endregion
        #region MaximumChi Notified Property
        private int _MaximumChi;
        public int MaximumChi
        {
            get
            {
                return _MaximumChi;
            }
            set
            {
                _MaximumChi = value;
                if (PropertyChanged != null)
                {
                    PropertyChanged(this, new PropertyChangedEventArgs(this.GetSymbolName(p => p.MaximumChi)));
                }
            }
        }
        #endregion
        #region PassiveDefense Notified Property
        private int _PassiveDefense;
        public int PassiveDefense
        {
            get
            {
                return _PassiveDefense;
            }
            set
            {
                _PassiveDefense = value;
                if (PropertyChanged != null)
                {
                    PropertyChanged(this, new PropertyChangedEventArgs(this.GetSymbolName(p => p.PassiveDefense)));
                }
            }
        }
        #endregion
        #region Resistance Notified Property
        private int _Resistance;
        public int Resistance
        {
            get
            {
                return _Resistance;
            }
            set
            {
                _Resistance = value;
                if (PropertyChanged != null)
                {
                    PropertyChanged(this, new PropertyChangedEventArgs(this.GetSymbolName(p => p.Resistance)));
                }
            }
        }
        #endregion

        // Character Abilities
        public ObservableCollection<CharacterAbility> FireSkills { get; private set; }
        public ObservableCollection<CharacterAbility> MetalSkills { get; private set; }
        public ObservableCollection<CharacterAbility> EarthSkills { get; private set; }
        public ObservableCollection<CharacterAbility> WoodSkills { get; private set; }
        public ObservableCollection<CharacterAbility> WaterSkills { get; private set; }
        public ObservableCollection<CharacterAbility> Taos { get; private set; }

        // Character Equipment
        #region ArmorName Notified Property
        private string _ArmorName;
        public string ArmorName
        {
            get
            {
                return _ArmorName;
            }
            set
            {
                _ArmorName = value;
                if (PropertyChanged != null)
                {
                    PropertyChanged(this, new PropertyChangedEventArgs(this.GetSymbolName(p => p.ArmorName)));
                }
            }
        }
        #endregion
        #region ArmorProtection Notified Property
        private int _ArmorProtection;
        public int ArmorProtection
        {
            get
            {
                return _ArmorProtection;
            }
            set
            {
                _ArmorProtection = value;
                if (PropertyChanged != null)
                {
                    PropertyChanged(this, new PropertyChangedEventArgs(this.GetSymbolName(p => p.ArmorProtection)));
                }
            }
        }
        #endregion
        public ObservableCollection<string> Equipment { get; private set; }
        public ObservableCollection<CharacterWeapon> Weapons { get; private set; }
    }
}
